window.onload = function(){
	$POSMENU=2
	new INFO().get();
	new CHECKLOGIN().check();
}
function setMode(mode){
	new INFO().set(mode);
}
INFO = function(){}
INFO.prototype.get=function(){
	var fncSuc = XHR.Delegate(this,this.getSuc);
	var param = {action:"getMode"};
	new XHR("post",fncSuc).send($PN+"/DoAdmin",param);
}
INFO.prototype.getSuc=function(r){
	var xml = r.xml;
	var html = "";
	if(getRV(xml)){
		var il = xml.getElementsByTagName("config")[0];
		$("lastRun").innerHTML = il.getAttribute("lastRun");
		$("totalTopNews").innerHTML = il.getAttribute("totalTopNews");		
		$("totalLatestNews").innerHTML = il.getAttribute("totalLatestNews");			
		$N("mode")[il.getAttribute("mode")].checked =true;
	}
}
INFO.prototype.set=function(mode){
	var fncSuc = XHR.Delegate(this,this.setSuc);
	var param = {action:"setMode",mode:mode};
	new XHR("post",fncSuc).send($PN+"/DoAdmin",param);
}
INFO.prototype.setSuc=function(r){
	var xml = r.xml;
	var html = "";
	if(getRV(xml)){
		alert("Done");
	}else{
		alert("False");
	}
}